<?php
require_once('include/header.php');
?>

<div class='notification'>
    <?php
    if (isset($_GET['order'])) {
        if ($_GET['order']) {
            echo '<font style=\'color:blue;\'>Đặt thành công đơn hàng #' . $_GET['order'] . '</font>';
        } else {
            echo '<font style=\'color:red;\'>Chưa đặt được món ăn!</font>';
        }
    }
    ?>
</div>
<div class="container">
    <div class="colum_right">
        <?php
        require_once('include/cart.php');
        require_once('include/queue.php');
        require_once('include/complete.php');
        ?>
    </div><!--====hết cột phải======-->

    <div class="content"><!--====nội dung giữa======-->

        <div class="box">
            <div class="box-heading">MÓN ĂN NHANH</div>
            <div class="box-content">
                <?php
                $lm = 6;
                $pdo = $conn->prepare('SELECT * FROM datab_product WHERE index_id=?');
                $pdo->execute(array(1));
                if ($pdo->rowCount()) {
                    $data = $pdo->fetchAll();
                    foreach ($data as $row) {
                        ?>
                        <div class="box-product">
                            <div class="box-image"><a class='ajax' href='productinfo.php?product_id=<?php echo $row['product_id']; ?>'> <img src='image/data/<?php echo $row['product_image']; ?>' /></a></div>
                            <div class="box-product-name"><?php echo $row['product_name']; ?></div>
                            <div class="box-price"><?php echo formatMoney($row['product_price']); ?> VNĐ</div>
                        </div>
                        <?php
                    }
                }
                ?> 
            </div>
        </div>
        <div class="box">
            <div class="box-heading">MÓN BÁNH</div>
            <div class="box-content">
                <?php
                $pdo = $conn->prepare('SELECT * FROM datab_product WHERE index_id=?');
                $pdo->execute(array(2));
                if ($pdo->rowCount()) {
                    $data = $pdo->fetchAll();
                    foreach ($data as $row2) {
                        ?>
                        <div class="box-product">
                            <div class="box-image"><a class='ajax' href='productinfo.php?product_id=<?php echo $row2['product_id']; ?>'> <img src='image/data/<?php echo $row2['product_image']; ?>' /></a></div>
                            <div class="box-product-name"><?php echo $row2['product_name']; ?></div>
                            <div class="box-price"><?php echo formatMoney($row2['product_price']); ?> VNĐ</div>
                        </div>
                        <?php
                    }
                }
                ?>      
            </div>
        </div>
        <div class="box">
            <div class="box-heading">ĐỒ UỐNG</div>
            <div class="box-content">
                <?php
                $pdo = $conn->prepare('SELECT * FROM datab_product WHERE index_id=?');
                $pdo->execute(array(3));
                if ($pdo->rowCount()) {
                    $data = $pdo->fetchAll();
                    foreach ($data as $row3) {
                        ?>
                        <div class="box-product">
                            <div class="box-image"><a class='ajax' href='productinfo.php?product_id=<?php echo $row3['product_id']; ?>'> <img src='image/data/<?php echo $row3['product_image']; ?>' /></a></div>
                            <div class="box-product-name"><?php echo $row3['product_name']; ?></div>
                            <div class="box-price"><?php echo formatMoney($row3['product_price']); ?> VNĐ</div>
                        </div>
                        <?php
                    }
                }
                ?>
            </div>
        </div>
    </div>

</div> <!--========hết container=========-->
<?php
include("include/footer.php");
?>